﻿namespace FrontEnd.Views
{
	using System.Collections.Generic;
	using System.Web.Mvc;
	using System.Web.Mvc.Html;

	public static class InputHtmlExtensions
	{
		public static string ClassifiedTextBox(this HtmlHelper htmlHelper, string name, string className)
		{
			IDictionary<string, object> htmlAttributes =
				new Dictionary<string, object>
					{
						{"class", className}
					};

			return htmlHelper.TextBox(name, null, htmlAttributes);
		}

		public static string RequiredTextBox(this HtmlHelper htmlHelper, string name)
		{
			return htmlHelper.ClassifiedTextBox(name, "required");			
		}

		public static string RequiredEmailTextBox(this HtmlHelper htmlHelper, string name)
		{
			return htmlHelper.ClassifiedTextBox(name, "required email");
		}

		public static string RequiredPasswordTextBox(this HtmlHelper htmlHelper, string name)
		{
			IDictionary<string, object> htmlAttributes =
				new Dictionary<string, object>
					{
						{"class", "required password"}
					};

			return htmlHelper.Password(name, null, htmlAttributes);
		}
	}
}
